package com.cvte.boe.media.utils.constant;

/**
 * Created by liyang on 2015/2/2.
 *
 * @功能 公共常量工具类
 */
public class Constant {

    public static int MAX_PREVIEW_VIDEO_RESOLUTION = 1920 * 1200;
    public static final String EXTRA_PLAYER_PKG = "com.cvte.tv.player";
    public static final String EXTRA_PLAYER_CLS_VIDEO = "com.cvte.tv.player.video.VideoPlayActivity";
    public static final String EXTRA_PLAYER_CLS_AUDIO = "com.cvte.tv.player.audio.AudioPlayActivity";
    public static final String EXTRA_PLAYER_CLS_PHOTO = "com.cvte.tv.player.photo.PhotoPlayActivity";
    public static final String SYS_PROP_CVT_EN_DSPLY_USB_NAME = "ro.CVT_EN_DSPLY_USB_NAME";
    public static final String SYS_PROP_CVT_EN_MEDIA_FIODER_HOTKEY = "ro.CVT_EN_MEDIA_FIODER_HOTKEY";

    public enum EBrowerType {
        ORDER_TYPE_NONE, ORDER_TYPE_TIME, ORDER_TYPE_CHARACTER, ORDER_TYPE_FOLDER, ORDER_TYPE_ALBUM, ORDER_TYPE_ARTIST;
    }

    public static final class MediaType {
        public static final int AUDIO = 6;
        public static final int AUDIOFOLDER = 11;
        public static final int DEVICE = 1;
        public static final int FOLDER = 2;
        public static final int IMAGE = 8;
        public static final int IMAGEFOLDER = 12;
        public static final int MEDIA = 9;
        public static final int SUBTITLE = 7;
        public static final int UNKNOWN_TYPE = -1;
        public static final int VIDEO = 4;
        public static final int VIDEOFOLDER = 10;
        public static final int APPLICATION = 16;
    }

    public static final class DeviceType {
        public static final int DEVICE_TYPE_CLOUD = -10;
        public static final int DEVICE_TYPE_DMS = 20;
        public static final int DEVICE_TYPE_INS = -13;
        public static final int DEVICE_TYPE_FAVORITE = 21;
        public static final int DEVICE_TYPE_OTHER_PRODUCT = 0;
        public static final int DEVICE_TYPE_SAMBA = -14;
        public static final int DEVICE_TYPE_SDCARD = -12;
        public static final int DEVICE_TYPE_SEARCH = 4;
        public static final int DEVICE_TYPE_USB = -11;
        public static final int DEVICE_TYPE_UNKNOWN = -1;

        public static boolean isDLNADevice(int devType) {
            switch (devType) {
                case DEVICE_TYPE_SAMBA:
                case DEVICE_TYPE_INS:
                case DEVICE_TYPE_SDCARD:
                case DEVICE_TYPE_USB:
                case DEVICE_TYPE_CLOUD:
                default:
                    return false;
                case DEVICE_TYPE_OTHER_PRODUCT:
                case DEVICE_TYPE_DMS:
            }
            return true;
        }

        public static boolean isExternalStorage(int devType) {
            switch (devType) {
                case DEVICE_TYPE_SAMBA:
                case DEVICE_TYPE_INS:
                case DEVICE_TYPE_SDCARD:
                case DEVICE_TYPE_USB:
                    return true;
                case DEVICE_TYPE_CLOUD:
                case DEVICE_TYPE_OTHER_PRODUCT:
                case DEVICE_TYPE_DMS:
                default:
                    return false;
            }
        }

        public static boolean isLocalDevice(int devType) {
            switch (devType) {
                case DEVICE_TYPE_SAMBA:
                case DEVICE_TYPE_INS:
                case DEVICE_TYPE_SDCARD:
                case DEVICE_TYPE_USB:
                    return true;
                default:
                    return false;
            }
        }
    }
}
